<style>

.dtable{display:table;width:auto;margin:0px auto;}
.drow{display:table-row;height:25px;line-height:25px;}
.dlcell{display:table-cell;text-align:right;width:180px;}
.drcell{display:table-cell;text-align:left;width:450px;padding-left:10px;}

</style>
<script charset="utf-8" src="/res/lib/kindeditor/kindeditor-min.js"></script>
<script charset="utf-8" src="/res/lib/kindeditor/zh_CN.js"></script>
<script type="text/javascript">
jQuery(function(){
	$('#lang').change(function(){
		$.get('/admin.php?mo=action&domo=product&do=getCategoryList&lang='+$(this).val()+'&ajax=1', function(data){
			$('#cid').empty();
			$.each(data, function(i,n) {
				$('<option value="'+n.id+'">'+n.name+'</option>').appendTo('#cid');
			});
		}, 'json');
	});
//	$('#cid').change(function(){
//		$('#cname').val($(this).find('option:selected').text());
//	});
	
});
var editor;
KindEditor.ready(function(K) {
	editor = K.create('textarea[name="content"]', {
		resizeType : 1,
		allowPreviewEmoticons : false,
		allowImageUpload : false,
		items : [
			'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
			'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
			'insertunorderedlist', '|', 'emoticons', 'image', 'link']
	});
});
</script>
<div id="main">
    <div class="dtable">
		<form action="admin.php?mo=action&domo=product&do=save" method="post" enctype="multipart/form-data" name="form1" id="form1">
        <input type="hidden" name="id" id="id" value="{$detail['id']}" />
        <div class="drow">
            <span class="dlcell">{$SelectLangVersionText}: </span>
            <span class="drcell">
            	<select id="lang" name="lang">
                {loop $langList $k $v}
                <option value="{$k}">{$v}</option>
                {/loop}
                </select>
            </span>
        </div>
        <div class="drow">
            <span class="dlcell">{$SelectProductCategoryText}: </span>
            <span class="drcell">
            	<select id="cid" name="cid">
                {loop $categoryList $k $v}
                <option value="{$v['id']}"{if $v['id']==$detail['cid']} selected="selected"{/if}>{$v['name']}</option>
                {/loop}
                </select>
            </span>
        </div>
        <div class="drow">
            <span class="dlcell">{$SelectPictureText}: <br/>
            {if $detail['id']}
            ({$ModifyNotNeedUploadPicture})
            {/if}</span>
            <span class="drcell">
            <input type="file" name="0" id="picfile" value="{$detail['picfile']}" />
            </span>
        </div>
        <div class="drow">
            <span class="dlcell">{$Recommend2IndexText}: </span>
            <span class="drcell">
            	<select id="recommend" name="recommend">
                {loop $yes_no $k $v}
                <option value="{$k}"{if $k==$detail['recommend']} selected="selected"{/if}>{$v}</option>
                {/loop}
                </select>
            </span>
        </div>
        <div class="drow"> 
        	<span class="dlcell">{$NameText}: </span>
            <span class="drcell">
            <input type="text" name="name" id="name" value="{$detail['name']}" size="50" maxlength="60" />
            </span>
        </div>
        <div class="drow">
            <span class="dlcell">{$ProductContentText}: </span>
            <span class="drcell">
            <textarea id="content" name="content" style="width:700px;height:200px;visibility:hidden;">{$detail['content']}</textarea>
            </span>
        </div>
        <div class="drow">
            <span class="dlcell"></span>
            <span class="drcell">
            <input type="submit" value="{$SubmitText}" />
            </span>
        </div>
        </form>
    </div>
</div>